package com.wjv.example.spbt.shiro.service;

import com.wjv.example.spbt.shiro.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>Title: UserServiceImpl</p>
 *
 * @author wjv
 * @date 2021/7/5 11:42
 */
@Service
public class UserServiceImpl {

    @Autowired
    private RoleServiceImpl roleService;

    /**
     * 模拟
     * 获取用户的基本信息、角色和权限
     * @param userName
     * @return
     */
    public UserInfo getUserInfo(String userName) {
        return UserInfo.builder()
                .userName(userName)
                .id(1)
                .phone("15011001100")
                .roleList(roleService.getRoleByUser(userName))
                .build();
    }
}
